<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - KeyValueField Usage</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset-fonts/reset-fonts.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="css/demo.css"/>
<link rel="stylesheet" type="text/css" href="css/dpSyntaxHighlighter.css">

 </head>

 <body>

<h1>inputEx - KeyValueField Usage</h1>

<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="../lib/yui/json/json-min.js"></script>

<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/mixins/choice.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/Group.js"  type='text/javascript'></script>
<script src="../js/fields/CombineField.js"  type='text/javascript'></script>
<script src="../js/fields/StringField.js"  type='text/javascript'></script>
<script src="../js/fields/UrlField.js"  type='text/javascript'></script>
<script src="../js/fields/SelectField.js"  type='text/javascript'></script>


<script src="../js/fields/KeyValueField-beta.js"  type='text/javascript'></script>


<script src="js/dpSyntaxHighlighter.js"></script>
<script src="inputex-examples.js"></script>


<!-- Example 1 -->
<div class='exampleDiv'>
 <h2>Basic KeyValueField creation</h2>
 <p>The KeyValueField makes it easy to build a search form from an existing inputEx definition</p>
 <div class='demoContainer' id='container1'></div>
 <div class='codeContainer'>
  <textarea name="code" class="JScript">
		var field = new inputEx.KeyValueField({
			parentEl: 'container1',
			availableFields: [
				{type: 'string', name: 'lastname', label: 'Lastname' },
				{type: 'string', name: 'firstname', label: 'Firstname' },
				{type: 'select', name: 'gender', label: 'Gender', choices: ["Mr","Mrs","Ms"] }
			]
		});
		
		var button = inputEx.cn('button', null, null, 'getValue()');
		YAHOO.util.Dom.get('container1').appendChild(button); 
		YAHOO.util.Event.addListener(button, 'click', function() { alert( YAHOO.lang.JSON.stringify(field.getValue())); });  
			
		
  </textarea>
 </div>
</div>


 </body>
</html>